package com.isias.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.isias.model.El.ElPaper;
import com.isias.model.El.ElQu;
import com.isias.model.dto.PaperQuPointDto;
import com.isias.model.vo.ElPaperQueryVo;
import com.isias.model.vo.ElQuQueryVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ElPaperMapper extends BaseMapper<ElPaper> {

    IPage<ElPaper> SelectPage(Page<ElPaper> pageparam, @Param("vo") ElPaperQueryVo elPaperQueryVo);

    List<ElQu> SelectQuByPaperId(String id,@Param("vo") ElQuQueryVo elQuQueryVo);

    List<String> SelectQuIdByPaperId(String id);    //通过paperid查询对应的quid

    List<String> AllSelectQuNumber(String id);

    Integer SelectQuNumberByType(String id,String type);

    void UpdatePaperQuNumber(int radio,int multi,int judge,int saq,String id);
    @Select("select count(*) from el_paper_qu where paper_id = #{paperId} and qu_id = #{quId} and is_deleted = 0")
    Integer findIdByRepoIdAndQuId(String paperId, String quId);

    Integer AddQuToRepo(String paperId, String quId);

    Integer removeQuToPaper(String paperId, String quId);

    PaperQuPointDto SelectQuPoint(String paperid);  //获取各个题目的分数

}
